<!-- parcelados/index -->
<% content_for :header do %>
	Despesa parcelada
<% end %>

<%= flash_alerts %>

<% if @parcelados.empty? %>
	<%= bootstrap_alert do %>
		<p>Nenhuma despesa parcelada encontrada</p>
	<% end %>
<% end %>

<% if @parcelados.any? %>
	<table class="table table-striped">
		<thead>
			<tr>
				<th>Observação</th>
				<th>Data</th>
				<th>Valor</th>
				<th>Saldo devedor</th>
				<th></th>
				<th></th>
			</tr>
		</thead>
	
		<tbody>
			<% @parcelados.each do |p| %>
				<tr>
					<td><%= "#{p.observacao} (#{p.parcelas}x)" %></td>
					<td class="text-center"><%= I18n.localize p.data %></td>
					<td class="text-center"><%= number_to_currency p.valor %></td>
					<td class="text-center"><%= number_to_currency p.saldo_devedor %></td>
					<td class="span1 text-center"><%= show_link p %></td>
					<td class="span1 text-center"><%= delete_link p %></td>
				</tr>
			<% end %>
		</tbody>	
	</table>
<% end %>

